package com.example.mytayunapi.Service;

import com.example.mytayunapi.Mapper.Share_postsInfoMapper;
import com.example.mytayunapi.Vo.ShareUserInfo;
import com.example.mytayunapi.Vo.ShareUserProducts;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class share_postsInfoServiceImpl implements share_postsInfoService {
    @Autowired
    private Share_postsInfoMapper share_postsinfoMapper;

    @Override
    public List<ShareUserInfo> getSharePostsInfo() {
        return share_postsinfoMapper.getSharePostsInfo();
    }

    @Override
    public List<ShareUserInfo> getShareTitleInfo(String Share_title) {
        return share_postsinfoMapper.getShareTitleInfo(Share_title);
    }

    @Override
    public Integer updateShareStatus(ShareUserInfo shareUserInfo) {
        return share_postsinfoMapper.updateShareStatus(shareUserInfo);
    }

    @Override
    public PageInfo<ShareUserInfo> getPageInfo(int pageNum, int pageSize) {
        PageHelper.startPage(pageNum, pageSize);
        List<ShareUserInfo> ShareUserInfo = share_postsinfoMapper.getSharePostsInfo();
        PageInfo<ShareUserInfo> pageInfo = new PageInfo<>(ShareUserInfo);
        return pageInfo;
    }
//
    @Override
    public List<ShareUserInfo> getSharePostsInfoStatus(String Share_status) {
        return share_postsinfoMapper.getSharePostsInfoStatus(Share_status);
    }

    @Override
    public List<ShareUserInfo> getSharePostsInfoStatusNa(String Share_status) {
        return share_postsinfoMapper.getSharePostsInfoStatusNa(Share_status);
    }

    @Override
    public List<ShareUserInfo> getSharetitleAndWord(String keyword, String Share_status) {
        return share_postsinfoMapper.getSharetitleAndWord(keyword,Share_status);
    }

    @Override
    public List<ShareUserInfo> getShareTitle(String keyword) {
        return share_postsinfoMapper.getShareTitle(keyword);
    }

    @Override
    public List<ShareUserProducts> getShareUserProducts(Integer Product_id) {
        return  share_postsinfoMapper.getShareUserProducts(Product_id);
    }


    @Override
    public List<ShareUserInfo> getShareTitleAndCate(String word) {
        return share_postsinfoMapper.getShareTitleAndCate(word);
    }

    @Override
    public List<ShareUserInfo> getShareTitleAndCateStatus(String keyword, String word) {
        return share_postsinfoMapper.getShareTitleAndCateStatus(keyword,word);
    }

    @Override
    public List<ShareUserInfo> getSharePosts(String Share_catagory) {
        return share_postsinfoMapper.getSharePosts(Share_catagory);
    }

    @Override
    public List<ShareUserInfo> getSharePostsDetail(Integer Share_id) {
        return share_postsinfoMapper.getSharePostsDetail(Share_id);
    }

    @Override
    public Integer deleteSharePosts(Integer Share_id) {
        return share_postsinfoMapper.deleteSharePosts(Share_id);
    }

    @Override
    public List<ShareUserInfo> getSharePostsInfoByPeople(String School_degree) {
        return share_postsinfoMapper.getSharePostsInfoByPeople(School_degree);
    }
}
